#include "loadingwidget.h"
#include "ui_loadingwidget.h"
#include<QDesktopWidget>
#include<QMovie>
#include"src/mes.h"
#include<QDebug>
#include<QTimer>

Loadingwidget::Loadingwidget(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::Loadingwidget)
{
    ui->setupUi(this);

    setWindowFlags(Qt::FramelessWindowHint);//无边框
    setAttribute(Qt::WA_TranslucentBackground);//背景透明

    //屏幕居中显示
    int frmX = width();
    int frmY = height();

    QDesktopWidget *w=QApplication::desktop();
    int deskWidth = w->width();
    int deskHeight = w->height();

    QPoint movePoint(deskWidth / 2 - frmX / 2, deskHeight / 2 - frmY / 2);
    move(movePoint);

    //加载gif图片
    QMovie *movie = new QMovie(":/2.gif");      // 1不透明，2透明 3 透明    用2；
    ui->lbl_gif->setMovie(movie);
    movie->start();

//    t=new QTimer(this);
//    t->setInterval(100);
//    t->start();
}

Loadingwidget::~Loadingwidget()
{
    delete ui;
}



//void Loadingwidget::showLoad(bool isOpen)
//{
//    close();
//}


//void Load::run()
//{
//    Loadingwidget l;
//    l.show();
//}
